﻿@using Ornament.MemberShip
@using Ornament.MemberShip.Permissions
@using Ornament.Web
@model Ornament.MVCWebFrame.Areas.MemberShips.Models.PermissionWizard
@{
    ViewBag.Title = "Choice Ressource";
    var resources = OrnamentContext.GetTypeResource();

    //找出已经选择的
    string selectedResourceId = resources[0];
    var thePermission = this.Model.GetPermission();
    if (thePermission.Resource != null)
    {
        if (thePermission.Resource is string)
        {
            selectedResourceId = (string)thePermission.Resource;
        }
    }
}
@foreach (var resourceInfo in resources)
{
    var checkedTag = selectedResourceId == resourceInfo ? "checked='checked'" : "";
    <p>
        <input type="radio" value="@resourceInfo" id="@resourceInfo" name="ResourceId" @checkedTag/>
        <label for="@resourceInfo">@resourceInfo</label>
    </p>
}
